<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>从证书中解析公钥，以供使用。</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.openssl-pkey-get-public" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_pkey_get_public</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">openssl_pkey_get_public</span> &mdash; <span class="dc-title">从证书中解析公钥，以供使用。</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.openssl-pkey-get-public-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_pkey_get_public</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$certificate</code></span>
   ) : <span class="type">resource</span></div>

  <p class="para rdfs-comment">
   <span class="function"><a href="openssl_get_publickey.html" class="function">openssl_get_publickey()</a></span> 从 <code class="parameter">certificate</code> 中解析公钥，供其他函数使用。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-pkey-get-public-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">certificate</code></dt>

     <dd>

      <p class="para">
       <code class="parameter">certificate</code> 可以是以下之一：
       <ol type="1">
        <li class="listitem"><span class="simpara">一个 X.509 证书资源</span></li>
        <li class="listitem"><span class="simpara">一个<var class="filename">file://path/to/file.pem</var>格式的字符串。文件名必须包含一个PEM编码的证书或者密钥(也许二者都有).
         </span>
        </li>
        <li class="listitem"><span class="simpara">一个 PEM 格式的公钥。</span></li>
       </ol>
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkey-get-public-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功，返回真实的密钥资源标识符，错误，则返回 <strong><code>FALSE</code></strong> 
  </p>
 </div>


</div></div></div></body></html>